import ajax from "@/utils/request";


//查看购物车
export function getCartListFn(data:{userid:string }){
    return ajax({
        url:'/cart/list',
        method:'post',
        data,
    })
}

//添加购物车
export function addCartListFn(data:{userid:string,proid:string,num:number }){
    return ajax({
        url:'/cart/add',
        method:'post',
        data,
    })
}

//更新购物车数量
export function updateCartNumFn(data:{cartid:string,num:number }){
    return ajax({
        url:'/cart/updatenum',
        method:'post',
        data,
    })
}


//删除单条数据
export function DelCartDataFn(data:{cartid:string}){
    return ajax({
        url:'/cart/remove',
        method:'post',
        data,
    })
}


//更新单个商品选中状态
export function SeleCartDataFn(data:{cartid:string,flag:boolean}){
    return ajax({
        url:'/cart/selectone',
        method:'post',
        data,
    })
}


//全选和取消全选
export function SeleAllFn(data:{userid:string,type:boolean}){
    return ajax({
        url:'/cart/selectall',
        method:'post',
        data,
    })
}
